﻿@model PlmPersonnelAttendanceViewModel
@{
    Layout = null;
    ViewBag.Title = "人员考勤-列表";
}
<script type="text/javascript">
    $(document).ready(function () {
        $(".comsplitpage").val("@ViewBag.numPerPage");
    });
</script>
@using (Html.BeginForm("SplitPage", "PlmPersonnelAttendance", null, FormMethod.Post, new { id = "pagerForm", onsubmit = "return divSearch(this, 'rykq_list" + ViewBag.type + "');" }))
{
    <input type="hidden" name="pageNum" value="1" />
    <input type="hidden" name="numPerPage" value="@(ViewBag.numPerPage)" />
    <ul class="searchBar">
        <li>
            <input type="hidden" name="input_section" value="@(ViewBag.Section)" />
            <input type="hidden" name="input_type" value="@(ViewBag.type)" />
            <span>考勤时间：</span>
            <input type="text" name="attendtime" value="@(ViewBag.attendtime)" format="yyyy-MM" class="date" />
        </li>
        <li><span>姓名：</span>
            <input type="text" name="attendname" value="@(ViewBag.attendname)" />
        </li>
        <li>
            <button type="submit" class="btn btn-success btn-xs">
                搜索</button>
        </li>
    </ul>
   
}
<div class="pageContent">
    <div class="panelBar" style="border-top:none;">
        <ul class="toolBar">
            @if (ViewBag.type == "1")
            {
          
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Edit1", "PersonnelLog_PlmPersonnelAttendance_PersonnelAttendanceEdit1",
                    Url.Action("PersonnelAttendanceEdit", "PlmPersonnelAttendance", new { id = "{ids}" }),
                    "修改",
                    new Dictionary<string, object>
                    {
                        {"class","edit"},{"rel","tzgl_tzsb_edit"} ,{"mask","true"},{"target","dialog"},{"width","480"},{"height","480"},{"warn","请选择一条信息!"}
                    })
                </li>
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Detail1", "PersonnelLog_PlmPersonnelAttendance_PersonnelAttendanceDetail1",
                    Url.Action("PersonnelAttendanceDetail", "PlmPersonnelAttendance", new { id = "{ids}" }),
                    "查看",
                    new Dictionary<string, object>
                    {
                        {"class","detail"},{"rel","tzgl_tzsb_detail"} ,{"mask","true"},{"target","dialog"},{"width","480"},{"height","320"},{"warn","请选择一条信息!"}
                    })
                </li>
                <li class="line">line</li>
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Download1", "PersonnelLog_PlmPersonnelAttendance_Download1",
                     "../../Areas/PersonnelLog/Upload/考勤记录模板.xls",
                    "模板",
                    new Dictionary<string, object>
                    {
                        {"class","download"},{"targettype","navTab"} ,{"title","模板下载"}
                    })
                </li>
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Input1", "PersonnelLog_PlmPersonnelAttendance_Input1",
                     Url.Action("IndexAttendance", "Import", new { url = "/PersonnelLog/PlmPersonnelAttendance/ImportExcelFile", Section = ViewBag.Section }),
                    "导入",
                    new Dictionary<string, object>
                    {
                        {"class","input"},{"rel","tzgl_tzsb_input"} ,{"lookupgroup","attachment"},{"width","320"},{"height","320"},{"title","导入EXCEL"}
                    })
                </li>
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Export1", "PersonnelLog_PlmPersonnelAttendance_Export1",
                     Url.Action("Excel", "PlmPersonnelAttendance", new { Section = ViewBag.Section, Date = ViewBag.attendtime }),
                    "导出",
                    new Dictionary<string, object>
                    {
                        {"class","export"},{"targettype","navTab"} ,{"title","导出EXCEL"}
                    })
                </li>
            }
            @if (ViewBag.type == "2")
            {
          
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Edit2", "PersonnelLog_PlmPersonnelAttendance_PersonnelAttendanceEdit2",
                    Url.Action("PersonnelAttendanceEdit", "PlmPersonnelAttendance", new { id = "{ids}" }),
                    "修改",
                    new Dictionary<string, object>
                    {
                        {"class","edit"},{"rel","tzgl_tzsb_edit"} ,{"mask","true"},{"target","dialog"},{"width","480"},{"height","480"},{"warn","请选择一条信息!"}
                    })
                </li>
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Detail2", "PersonnelLog_PlmPersonnelAttendance_PersonnelAttendanceDetail2",
                    Url.Action("PersonnelAttendanceDetail", "PlmPersonnelAttendance", new { id = "{ids}" }),
                    "查看",
                    new Dictionary<string, object>
                    {
                        {"class","detail"},{"rel","tzgl_tzsb_detail"} ,{"mask","true"},{"target","dialog"},{"width","480"},{"height","320"},{"warn","请选择一条信息!"}
                    })
                </li>
                <li class="line">line</li>
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Download2", "PersonnelLog_PlmPersonnelAttendance_Download2",
                       "../../Areas/PersonnelLog/Upload/考勤记录模板.xls",
                    "模板",
                    new Dictionary<string, object>
                    {
                        {"class","download"},{"targettype","navTab"} ,{"title","模板下载"}
                    })
                </li>
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Input2", "PersonnelLog_PlmPersonnelAttendance_Input2",
                     Url.Action("IndexAttendance", "Import", new { url = "/PersonnelLog/PlmPersonnelAttendance/ImportExcelFile", Section = ViewBag.Section }),
                    "导入",
                    new Dictionary<string, object>
                    {
                        {"class","input"},{"rel","tzgl_tzsb_input"} ,{"lookupgroup","attachment"},{"width","320"},{"height","320"},{"title","导入EXCEL"}
                    })
                </li>
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Export2", "PersonnelLog_PlmPersonnelAttendance_Export2",
                     Url.Action("Excel", "PlmPersonnelAttendance", new { Section = ViewBag.Section, Date = ViewBag.attendtime }),
                    "导出",
                    new Dictionary<string, object>
                    {
                        {"class","export"},{"targettype","navTab"} ,{"title","导出EXCEL"}
                    })
                </li>
            }
            @if (ViewBag.type == "3")
            {
          
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Edit3", "PersonnelLog_PlmPersonnelAttendance_PersonnelAttendanceEdit3",
                    Url.Action("PersonnelAttendanceEdit", "PlmPersonnelAttendance", new { id = "{ids}" }),
                    "修改",
                    new Dictionary<string, object>
                    {
                        {"class","edit"},{"rel","tzgl_tzsb_edit"} ,{"mask","true"},{"target","dialog"},{"width","480"},{"height","480"},{"warn","请选择一条信息!"}
                    })
                </li>
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Detail3", "PersonnelLog_PlmPersonnelAttendance_PersonnelAttendanceDetail3",
                    Url.Action("PersonnelAttendanceDetail", "PlmPersonnelAttendance", new { id = "{ids}" }),
                    "查看",
                    new Dictionary<string, object>
                    {
                        {"class","detail"},{"rel","tzgl_tzsb_detail"} ,{"mask","true"},{"target","dialog"},{"width","480"},{"height","320"},{"warn","请选择一条信息!"}
                    })
                </li>
                <li class="line">line</li>
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Download3", "PersonnelLog_PlmPersonnelAttendance_Download3",
                      "../../Areas/PersonnelLog/Upload/考勤记录模板.xls",
                    "模板",
                    new Dictionary<string, object>
                    {
                        {"class","download"},{"targettype","navTab"} ,{"title","模板下载"}
                    })
                </li>
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Input3", "PersonnelLog_PlmPersonnelAttendance_Input3",
                    Url.Action("IndexAttendance", "Import", new { url = "/PersonnelLog/PlmPersonnelAttendance/ImportExcelFile", Section = ViewBag.Section }),
                    "导入",
                    new Dictionary<string, object>
                    {
                        {"class","input"},{"rel","tzgl_tzsb_input"} ,{"lookupgroup","attachment"},{"width","320"},{"height","320"},{"title","导入EXCEL"}
                    })
                </li>
                <li>
                    @Html.PermissionButton("PersonnelLog.PlmPersonnelAttendance.Export3", "PersonnelLog_PlmPersonnelAttendance_Export3",
                     Url.Action("Excel", "PlmPersonnelAttendance", new { Section = ViewBag.Section, Date = ViewBag.attendtime }),
                    "导出",
                    new Dictionary<string, object>
                    {
                        {"class","export"},{"targettype","navTab"} ,{"title","导出EXCEL"}
                    })
                </li>
            }
        </ul>
    </div>
    <table class="table" width="100%" layouth="122" nowraptd="false" rel="rykq_list@(ViewBag.type)">
        <thead>
            <tr>
                <th width="30" align="center">
                    序号
                </th>
                <th width="110" align="center">
                    工号
                </th>
                <th width="90" align="center">
                    姓名
                </th>
                <th width="80" align="center">
                    应出勤天数
                </th>
                <th width="80" align="center">
                    出勤天数
                </th>
                <th width="80" align="center">
                    缺勤天数
                </th>
                <th width="80" align="center">
                    请假天数
                </th>
                <th width="80" align="center">
                    请假记录
                </th>
                <th width="80" align="center">
                    罚款金额
                </th>
                <th width="80" align="center">
                    备注
                </th>
            </tr>
        </thead>
        <tbody>
            @{ int num = (ViewBag.pageNum - 1) * ViewBag.numPerPage;}
            @foreach (var item in Model.PersonnelAttendanceList)
            {
                num += 1;
                <tr target="ids" rel="@item.PA_ID" >
                    <td align="center">@num
                    </td>
                    <td align="center">@item.PA_JobNum
                    </td>
                    <td align="center">
                        <a style="color:#000;" href="@Url.Action("PersonnelAttendanceDetail", "PlmPersonnelAttendance", new { id = item.PA_ID })" rel="tzgl_tzsb_detail" mask="true" target="dialog" width="720" height="300">@item.PA_PersonnelName</a>
                    </td>
                    <td align="center">@item.PA_WorkDay
                    </td>
                    <td align="center">@item.PA_AttendanceDay
                    </td>
                    <td align="center">@item.PA_AbsenceDay
                    </td>
                    <td align="center">@item.PA_LeaveDay
                    </td>
                    <td align="center">@item.PA_LeaveRecord
                    </td>
                    <td align="center">@item.PA_Fine
                    </td>
                    <td align="center">@item.PA_Remark
                    </td>
                </tr>              
            }
        </tbody>
    </table>
    <div class="panelBar" style="border-bottom:none;">
        <div class="pages" style="float: right">
            <span>显示</span>
            <select class="comsplitpage" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value}, 'rykq_list@(ViewBag.type)')">
                <option value="10">10</option>
                <option selected="selected" value="20">20</option>
                <option value="50">50</option>
            </select>
            <span>条，共@(ViewBag.pagenumshown)页,@(ViewBag.totalcount)条</span>
        </div>
        <div class="pagination" style="margin:0px;float:left; margin-left:35%" rel="rykq_list@(ViewBag.type)" totalcount="@(ViewBag.totalcount)" numperpage="@(ViewBag.numPerPage)" pagenumshown="10" currentpage="@(ViewBag.pageNum)">
        </div>
    </div>
</div>
